<template>
	<view class="contina">
		<view class="w">
			<view class="card">
				<u-cell-group :border="false" :titleStyle="{ width: '230rpx' }">
					<u-cell title="修改手机号" @click="toPath(1)">
						<template #right-icon>
							<u-icon name="arrow-right"></u-icon>
						</template>
					</u-cell>
					<u-cell title="修改密码" @click="toPath(2)">
						<template #right-icon>
							<u-icon name="arrow-right"></u-icon>
						</template>
					</u-cell>
					<u-cell title="注销账号" @click="toPath(3)">
						<template #right-icon>
							<u-icon name="arrow-right"></u-icon>
						</template>
					</u-cell>
				</u-cell-group>
			</view>
			<view class="card" style="margin-top: 20rpx;">
				<u-cell-group :border="false" :titleStyle="{ width: '230rpx' }">
					<u-cell title="服务协议" @click="toPath(4)">
						<template #right-icon>
							<u-icon name="arrow-right"></u-icon>
						</template>
					</u-cell>
					<u-cell title="隐私政策" @click="toPath(5)">
						<template #right-icon>
							<u-icon name="arrow-right"></u-icon>
						</template>
					</u-cell>
				</u-cell-group>
			</view>
		</view>
		<flooterCom text="退出登录" @click="logout"></flooterCom>
	</view>
</template>

<script>
	import flooterCom from "@/compoment/flooterCom.vue"
	export default {
		data() {
			return {

			};
		},
		components: {
			flooterCom
		},
		methods: {
			toPath(key) {
				switch (key) {
					case 1:
						uni.navigateTo({
							url: '/pagesB/setTel/setTel'
						})
						break;
					case 2:
						uni.navigateTo({
							url: '/pagesB/setPwd/setPwd'
						})
						break;
					case 3:
						uni.navigateTo({
							url: '/pagesB/caaccount/caaccount'
						})
						break;
					case 4:
						uni.navigateTo({
							url: '/pages/arctile/detail?code=yhxy'
						})
						break;
					case 5:
						uni.navigateTo({
							url: '/pages/arctile/detail?code=yszc'
						})
						break;

					default:
						break;
				}
			},
			logout() {
				uni.showModal({
					content: '确定退出吗？',
					success: (res) => {
						if (res.confirm) {
							this.$fun.removeToken()
							this.$fun.tipTopage('退出成功', '/pages/login/login')
						}
					}
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.contina {
		background-color: #F8F8F8;
	}

	.card {

		box-shadow: 0px 2px 5px 0px rgba(154, 154, 154, 0.302);
	}

	::v-deep .u-cell__body {
		padding: 20rpx 0;
	}
</style>